﻿<Window x:Class="JobBoardAdminPanel.Views.EditOffersWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="EditOffersWindow" MinHeight="600" MinWidth="900">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="0,5*"/>
            <RowDefinition Height="0,5*"/>
        </Grid.RowDefinitions>

        <DataGrid x:Name="DataGridOffers" Grid.Row="0" ItemsSource="{Binding Offers}"
                  AutoGenerateColumns="False" CanUserAddRows="False"
                  SelectedItem="{Binding CurrentOffer}" IsReadOnly="True">
            <DataGrid.Columns>
                <DataGridTextColumn Header="ID" Binding="{Binding OfferID}"/>
                <DataGridTextColumn Header="JobTitle" Binding="{Binding JobTitle}"/>
                <DataGridTextColumn Header="Status" Binding="{Binding Status}"/>
                <DataGridTextColumn Header="PublishDate" Binding="{Binding PublishDate}"/>
                <DataGridTextColumn Header="DaysRemaining" Binding="{Binding ValidDaysRemaining}"/>
                <DataGridTextColumn Header="Industry" Binding="{Binding Industry.IndustryName}"/>
                <DataGridTextColumn Header="Company" Binding="{Binding Company.Name}"/>
                <DataGridTextColumn Header="Country" Binding="{Binding Country}"/>
                <DataGridTextColumn Header="City" Binding="{Binding City}"/>
                <DataGridTextColumn Header="Description" Binding="{Binding JobDescription}"/>
            </DataGrid.Columns>
        </DataGrid>
        
        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <StackPanel Orientation="Vertical">
                <TextBlock Text="EditItem" FontWeight="ExtraBold"/>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="ID: " Width="80"/>
                    <TextBlock Text="{Binding CurrentOffer.OfferID}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="JobTitle:" Width="80"/>
                    <TextBox Width="150" Text="{Binding CurrentOffer.JobTitle}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Status:" Width="80"/>
                    <ComboBox ItemsSource="{Binding Statuses}" SelectedItem="{Binding CurrentStatus}" 
                              DisplayMemberPath="StatusName" Width="80"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="DaysOfValidity:" Width="80"/>
                    <TextBox Width="150" Text="{Binding CurrentOffer.ValidDaysRemaining}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Industry:" Width="80"/>
                    <ComboBox ItemsSource="{Binding Industries}" SelectedItem="{Binding CurrentIndustry}" 
                              DisplayMemberPath="IndustryName" Width="80"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Company:" Width="80"/>
                    <ComboBox ItemsSource="{Binding Companies}" SelectedItem="{Binding CurrentCompany}" 
                              DisplayMemberPath="Name" Width="80"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Country:" Width="80"/>
                    <ComboBox ItemsSource="{Binding Countries}" SelectedItem="{Binding CurrentCountry}" 
                              DisplayMemberPath="CountryName" Width="80"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="City:" Width="80"/>
                    <ComboBox ItemsSource="{Binding Cities}" SelectedItem="{Binding CurrentCity}" 
                              DisplayMemberPath="CityName" Width="80"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Button Name="ButtonSave" Content="Save" Command="{Binding SaveCommand}"/>
                    <Button Name="ButtonDelete" Content="Delete" Command="{Binding DeleteCommand}"/>
                </StackPanel>
            </StackPanel>
            <StackPanel Orientation="Vertical">
                <TextBlock Text="InsertItem" FontWeight="ExtraBold"/>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="ID: " Width="80"/>
                    <TextBlock Text="{Binding NewOffer.OfferID}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="JobTitle:" Width="80"/>
                    <TextBox Width="150" Text="{Binding NewOffer.JobTitle}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Status:" Width="80"/>
                    <ComboBox ItemsSource="{Binding Statuses}" SelectedItem="{Binding CurrentStatus}" 
                              DisplayMemberPath="StatusName" Width="80"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="DaysOfValidity:" Width="80"/>
                    <TextBox Width="150" Text="{Binding NewOffer.ValidDaysRemaining}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Industry:" Width="80"/>
                    <ComboBox ItemsSource="{Binding Industries}" SelectedItem="{Binding CurrentIndustry}" 
                              DisplayMemberPath="IndustryName" Width="80"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Company:" Width="80"/>
                    <ComboBox ItemsSource="{Binding Companies}" SelectedItem="{Binding CurrentCompany}" 
                              DisplayMemberPath="Name" Width="80"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Country:" Width="80"/>
                    <ComboBox ItemsSource="{Binding Countries}" SelectedItem="{Binding CurrentCountry}" 
                              DisplayMemberPath="CountryName" Width="80"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="City:" Width="80"/>
                    <ComboBox ItemsSource="{Binding Cities}" SelectedItem="{Binding CurrentCity}" 
                              DisplayMemberPath="CityName" Width="80"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Description:" Width="80"/>
                    <TextBox Width="150" Text="{Binding NewOffer.JobDescription}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Button Name="ButtonAdd" Content="Add" Command="{Binding AddCommand}"/>

                </StackPanel>
            </StackPanel>
        </StackPanel>
    </Grid>
</Window>
